function ValidateForm()
{
	var formId = document.getElementById('formId').getAttribute('name');	
	var err=0;
	
	if(formId == "artistForm")
		{	
			var name = document.forms['artistForm'].name;
			var beschreibung = document.forms['artistForm'].description;
			var genre = document.forms['artistForm'].genre;
			
			
			if ((name.value==null)||(name.value==""))
			{
				name.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				name.parentElement.parentElement.className="verification-pass";
			}

		
			if ((beschreibung.value==null)||(beschreibung.value==""))
			{
				beschreibung.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				beschreibung.parentElement.parentElement.className="verification-pass";
			}
					
			if ((genre.value==null)||(genre.value==""))
			{
				genre.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				genre.parentElement.parentElement.className="verification-pass";
			}
			

		}
	
	else if(formId == "locationForm")
		{
			var name = document.forms['locationForm'].name;
			var strasse = document.forms['locationForm'].strasse;
			var plz = document.forms['locationForm'].plz;
			var ort = document.forms['locationForm'].ort;
			
			if ((name.value==null)||(name.value==""))
			{
				name.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				name.parentElement.parentElement.className="verification-pass";
			}


			
			if ((strasse.value==null)||(strasse.value==""))
			{
				strasse.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				strasse.parentElement.parentElement.className="verification-pass";
			}


			
			if ((plz.value==null)||(plz.value=="")||(plz.value.length != 5)||($.isNumeric(plz.value)==false)||(ort.value==null)||(ort.value==""))
			{
				plz.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				plz.parentElement.parentElement.className="verification-pass";
			}
		
		}
	
	else if(formId == "eventForm")
		{
			var name = document.forms['eventForm'].name;
			var beschreibung = document.forms['eventForm'].description;
			var preis = document.forms['eventForm'].price;
			var begin = document.forms['eventForm'].begin;
			var end = document.forms['eventForm'].end;
			var location = document.forms['eventForm'].id;
			var artists = document.forms['eventForm'].slot;
			
			preis.value = preis.value.replace(/\./g,",");
			
			if ((name.value==null)||(name.value==""))
			{
				name.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				name.parentElement.parentElement.className="verification-pass";
			}
			
			if ((beschreibung.value==null)||(beschreibung.value==""))
			{
				beschreibung.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				beschreibung.parentElement.parentElement.className="verification-pass";
			}
			
			if ((preis.value==null)||(preis.value=="")||($.isNumeric(preis.value.replace(/,/g,"."))==false))
			{
				preis.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				preis.parentElement.parentElement.className="verification-pass";
			}

			if (!(location.value>=0))
			{
				location.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				location.parentElement.parentElement.className="verification-pass";
			}

			if ((artists.value==null)||(artists.value==""))
			{
				artists.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				artists.parentElement.parentElement.className="verification-pass";
			}
			
			if ((begin.value==null)||(begin.value==""))
			{
				begin.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				begin.parentElement.parentElement.className="verification-pass";
			}
			
			if ((end.value==null)||(end.value=="")||!(Date.parse(end.value) > Date.parse(begin.value)))
			{
				end.parentElement.parentElement.className="verification-error";
				err++;
			} else {
				end.parentElement.parentElement.className="verification-pass";
			}
		}

	
	if(err>0){
		document.getElementById('submit').disabled = true; 
	} else {
		document.getElementById('submit').disabled = false; 
	}
			
}